<?php
require("/model/ContinentModel.class.php");
require("CountryController.class.php");

class ContinentController
{
    var $db;

    function __construct($db_link)
    {
        $this->db = $db_link;
    }

    function getAllContinents()
    {
        $c = new ContinentModel($this->db);
        return $c->getAllContinents();
    }

    function countCountries($continent_id)
    {
        $countryController= new CountryController($this->db);
        return count($countryController->getAllCountriesOnContinent($continent_id));
    }

    function getContinent($continent_id)
    {
        $c = new ContinentModel($this->db);
        return $c->getContinent($continent_id);
    }
}
?>